trait Logger {  
  def log(message: String): Unit  
}  
  
class Calculator extends Logger {  
  
  override def log(message: String): Unit = {  
    println(message) 
  }  
  

  def add(x: Int, y: Int): Int = {  
    val result = x + y  
    log(s"Performed addition: $x + $y = $result")  
    result  
  }  
  
 
  def subtract(x: Int, y: Int): Int = {  
    val result = x - y  
    log(s"Performed subtraction: $x - $y = $result")  
    result  
  }  
}  
  

object Main {  
  def main(args: Array[String]): Unit = {  
    val calculator = new Calculator()  
    val sum = calculator.add(5, 3)  
    val difference = calculator.subtract(sum, 2)  
  }  
}
